<!-- #include file="common.asp" -->
<%
dim codeStr
public ControllerName, ActionName, Id
private Controller

' 运行控制器
ControllerName = Request.QueryString("controller")
if ControllerName = "" or ControllerName = empty then
	ControllerName = "Home"
end if
path = "controllers/" & ControllerName & ".asp"
include path
codeStr = "set Controller = new " & ControllerName & vbCrLf

' 获取当前动作
ActionName = trim(Request.QueryString("action"))
if ActionName = "" or ActionName = empty then
	codeStr = codeStr & "Controller()" & vbCrLf
	ActionName = "Index"
else
	codeStr = codeStr & "Controller." & ActionName & "()" & vbCrLf
end if

' 获取当前Id
Id = Request.QueryString("id")
if Id = "" or not isnumeric(Id) then
	Id = empty
end if

' 执行动作
execute codeStr
if err then
	showError()
end if

on error resume next
path = "views/" & ControllerName & "/" & ActionName & ".asp"
include path
	
%>